package chat7me_1223.server.vo;

import java.net.Socket;
import java.util.Objects;

public class UserData {
	private Socket socket;
	private String username;
	private String password;

	public UserData() {
	}

	public UserData(String username, String password) {
		this.username = username;
		this.password = password;
	}

	public UserData(Socket socket, String username, String password) {
		this.socket = socket;
		this.username = username;
		this.password = password;
	}

	public Socket getSocket() {
		return socket;
	}

	public void setSocket(Socket socket) {
		this.socket = socket;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		UserData userData = (UserData) o;
		return Objects.equals(username, userData.username) && Objects.equals(password, userData.password);
	}

	public int hashCode() {
		return Objects.hash(username, password);
	}

	public String toString() {
		return "UserData{" +
				"username='" + username + '\'' +
				", password='" + password + '\'' +
				'}';
	}
}
